fix(openvpn): survive server-initiated soft reset and rekey - #3109
fix(openvpn): survive server-initiated soft reset and rekey#3109ayanami-desu wants to merge 4 commits into
Conversation
|
The PR does not fully implement the fault-tolerance semantics of the original |
|
However, you need to fix the Go 1.20 compatibility issue; do not use |
|
Also need fix |
|
Verified and pushed as
Verification:
|
Do not turn data packet-ID exhaustion into silent success
OpenVPN does not wait for actual exhaustion: Anchor
|
|
Addressed in Data packet-ID exhaustionThe silent-success path has been removed. I also moved the cutoff from actual uint32 exhaustion to OpenVPN's Tests now verify:
AUTH_PENDING establishment anchor
This occurs before any trailing/coalesced The real TLS rekey test now preloads a stale prior-epoch timestamp, completes TLS and client KM2, blocks the server before server KM2, and verifies that the anchor is still zero. It then releases server KM2 and verifies both the new anchor position and Verification after the final patch:
I also ran three independent read-only subagent reviews covering packet-ID/security boundaries, AUTH_PENDING/KM2 lifecycle, and the complete diff/callsites. All three reported no actionable findings. |
Fixes #3085.
Supersedes the closed review iteration in #3107. This version is rebased onto the current
Alphabranch and incorporates the complete follow-up audit.Summary
P_CONTROL_SOFT_RESET_V1as a fresh TLS/key epoch and follow OpenVPN's0 → 1 → … → 7 → 1key-ID sequence.AUTH_PENDING, token refresh, push continuation, and shortened KM2 records across arbitrary TLS read boundaries.tran-windowfrom explicit zero; reject negative and overflowing values.Compatibility and safety details
AUTH_FAILED,RESTART,HALT, andEXITtake precedence over coalesced push data without leaking adjacent auth tokens.auth-token-user, invalidpush-continuation, oversized control buffers, stale sessions, and invalid ACK arrays are rejected.Tests
go test ./transport/openvpn ./adapter/outbound -count=1go test -race ./transport/openvpn -count=1go vet ./...SKIP_INTEROP_TEST=1 SKIP_CONCURRENT_TEST=1 go test ./... -count=1SKIP_INTEROP_TEST=1 SKIP_CONCURRENT_TEST=1 go test ./... -tags with_gvisor -count=1The branch is a single commit directly on the current upstream
Alphahead.